<template>
	<!--POP画册、POP下单、道具下单-->
	<view class="page-content">
		<view class="page-top">
			<!-- 标题栏和状态栏占位符 -->
			<view class="titleNview-placing"></view>
			<!-- 标题+筛选 -->
			<w-sel-search topType="two" :col_num="4" label_height="52" :pageobj="pageobj" :popHeight="pageType ==='pop'?'630':pageType ==='prop'?'320':'320'"
				leftIcon="arrowleft" :cenTit="page_title" cenType="title" iconfont="28" :is_back="false" @back="back"
				@resetFilterData="resetFilterData" @selectRadioLabel="selectRadioLabel" @setFilterData="setFilterData">
			</w-sel-search>
		</view>
		<scroll-view class="page-body" :scroll-top="scrollTop" scroll-y="true" @scrolltolower="loadmore()">
			<!--产品图片数据-->
			<template v-if="objdata.objlist && objdata.objlist.length > 0 ">
				<view class="body-box">
					<product-num-edit :obj="objdata.objlist" :list="list2" :is_edit="false" @sel_mats="sel_mats" @choose="choose"
						:delBtnWidth="0"  @rednum2="rednum2" @addnum2="addnum2" @addnum1="addnum1" @rednum1="rednum1"
						@addnum0="addnum0" @rednum0="rednum0" @delItem0="delItem0" @confirm="confirm2"
						:pageType="pageType">
					</product-num-edit>
				</view>
				<view class="btn-box">
					<view class="submit" @tap="confirm()">下一步</view>
				</view>
				<!-- 上拉加载 -->
				<view class="det-con-more">
					<load-more :loadmore="load_more1"></load-more>
				</view>
			</template>
			<!--无数据-->
			<empty v-else no-full type="noData"></empty>
		</scroll-view>
		<!-- <w-popup :show="showtip" :type="type1" @change="change1">
			<view class="w-tip">
				<view class="w-tit">设置定制</view>
				<scroll-view class="w-con" :scroll-top="scrollTop2" scroll-y="true">
					<view class="w-con-t">材质：</view>
					<view class="w-con-c">
						<block v-for="(item,index) in list" :key="index">
							<view class="w-con-c-li" @click.stop="choose(index)"
								:style="{background:item.statu?'#CBE6FF':'#f5f5f5',color:item.statu?'#198FFF':'#999'}">
								{{item.name}}
							</view>
						</block>
					</view>
				</scroll-view>
				<view class="w-but">
					<view class="w-but-txt" @click.stop="cancel('tip')">取消</view>
					<view class="w-but-txt" @click.stop="confirm2">确认</view>
				</view>
			</view>
		</w-popup> -->
	</view>
</template>

<script>
	import wSelSearch from '@/components/w-sel-logo/w-sel-search.vue'; //标题
	import loadMore from '@/components/uni-load-more/load-more.vue';
	import productNumEdit from '@/pages/components/product_num_edit2.vue';
	import wPopup from '@/components/w-popup/w-popup2.vue';
	import {
		mapGetters,
		mapActions
	} from "vuex";
	import {
		taskDataInfos, //获取任务详情
		getFlowLists, //获取流程
		getProductCodingLists, //pop列表
		saveTaskDatas, //保存
		editTasks, //编辑流程
		getOssUploadsParams,
		getProductAttrLists, //获取产品属性列表
		getProductTextureLists, //材质列表
		orderInfos, //订单详情

	} from '@/common/api.js';
	export default {
		components: {
			loadMore,
			productNumEdit,
			wSelSearch,
			wPopup
		},
		data() {
			return {
				page_title: '',
				pageobj: {
					name: '单选',
					type: 'radio',
					submenu: []
				},
				scrollTop: 0,
				noData: false,
				load_more1: '', //下拉加载文字
				page_title: '',
				objdata: {
					id: 1,
					image: '/static/data-img/img.jpg',
					title: '任务名任务名任务名任务名',
					flowname: '',
					datalist: [],
					objlist: []
				},
				list2: [],

				sel_img_index: 0, //选择当前项
				params: {
					id: '',
					company_id: '',
					product_attr_id: [],
					product_coding_id: []
				},
				pageType: '',
				pagedata: {
					company_id: '',
					top_id: '',
					type: ''
				},
				list:[],
				scrollTop2: 0,
				sel_ind: 0,
				showtip: false, //是否显示弹窗1
				content1: '顶部弹 popup',
				type1: '', //弹窗显示方式
				order_id:'',
				jsondata:'',
				order_list:[],
			}
		},
		computed: {
			...mapGetters(['companyInfo', 'userInfo']),
		},
		onShow() {
			
		},
		onLoad(option) {
			console.log(222, option)
			this.params.company_id = this.companyInfo.id;
			this.pagedata.company_id = this.companyInfo.id;
			if (!!option.title) {
				this.page_title = option.title;
			}
			if (option.id) {
				this.params.id = option.id;
			}
			this.getdata2();
			if (option.pageType) {
				this.pageType = option.pageType;
				if(option.order_id){
					this.order_id = option.order_id;
					//this.getdata3(); //获取再下一单的数据
				}
				this.getdata();
			}
			if(option.flow_path_id){
				this.objdata.flow_path_id = option.flow_path_id;
			}
			
		},
		methods: {
			//材质删除
			delItem0(index, ind) {
				if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (index === i) {
							let list = item.textures
							delete list[ind]
							item.textures = list.filter(Boolean)
						}
					})
				}
			},
			//材质减少数量
			rednum0(index,ind){
				if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (index === i) {
							if (item.textures && item.textures.length > 0) {
								item.textures.forEach((item2, ii) => {
									if (ind === ii) {
										if (item2.number > 0) {
											item2.number -= 1
										}
									}
								})
							}
						}
					})
				}
			},
			//材质增加数量
			addnum0(index,ind){
				console.log('材质增加',index,ind)
				console.log(1112,this.objdata.objlist)
				/* if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (index === i) {
							if (item.textures && item.textures.length > 0) {
								item.textures.forEach((item2, ii) => {
									if (ind === ii) {
										console.log(1111,item2)
										item2.number += 1
									}
								})
							}
						}
					})
				} */
				let resData = this.objdata.objlist;
				if(resData && resData.length>0){
					for(let i = 0;i < resData.length;i++){
						if(i === index){
							for(let ii = 0;ii < resData[i].textures.length;ii++){
								if(ii === ind){
									resData[i].textures[ii].number += 1;
								}
							}
						}
					}
				}
			},
			//确认材质
			confirm2(){
				console.log(1111,this.objdata.objlist)
				let resdata = this.objdata.objlist.map((item)=>({
					...item
				}))
				const list  = this.list2;
				let textures = [];
				if(list && list.length>0){
					list.forEach(item=>{
						if(item.statu){
							textures.push(item)
						}
					})
				}
				resdata[this.sel_ind].textures = textures;
				this.objdata.objlist = resdata;
				this.showtip = false;
			},
			//选择材质
			choose(index){
				if(this.list2 && this.list2.length>0){
					this.list2.forEach((item,ind)=>{
						if(index === ind){
							item.statu = true
						}
					})
				}
			},
			//选择材质
			sel_mats(index){
				this.sel_ind = parseInt(index);
				//材质
				getProductTextureLists({company_id:this.params.company_id}).then(res=>{
					if(res.code === 2000){
						const data  = res.data.map((item)=>({
							name:item.name,
							statu:false,
							width:'',
							height:'',
							number:0,
							texture_name:item.name,
							texture_id:item.id
						}))
						this.list2 = data;
						if(this.objdata.objlist && this.objdata.objlist.length>0){
							this.objdata.objlist.forEach((item,index)=>{
								if(index === parseInt(this.sel_ind)){
									if(item.textures && item.textures.length>0){
										item.textures.forEach((item2,index2)=>{
											if(this.list2 && this.list2.length>0){
												this.list2.forEach((ite,ind)=>{
													if(item2.id === ite.id){
														ite.statu = true
													}
												})
											}
										})
									}
								}
							})
						}
					}
				})
				
				// this.content1 = 'center'
				// this.type1 = 'center';
				// this.showtip = true;
			},
			getdata2() {
				if (this.pageType === 'pop') { //pop
					this.pagedata.top_id = 0;
					this.pagedata.type = 1;
					getProductCodingLists(this.pagedata).then(res => {
						if (res.code === 2000) {
							let pageobj = {
								type: 'radio',
								submenu: [],
							}
							let submenu = {
								type: 'one',
								submenu: [],
							}
							submenu.submenu = res.data;
							if (submenu.submenu && submenu.submenu.length > 0) {
								submenu.submenu.forEach(item => {
									this.$set(item, 'selected', false);
								})
							}
							pageobj.submenu.push(submenu);
							getProductAttrLists(this.pagedata).then(res => {
								if (res.code === 2000) {
									let submenu2 = res.data;
									if (submenu2 && submenu2.length > 0) {
										submenu2.forEach(item2 => {
											this.$set(item2, 'submenu', Array);
											this.$set(item2, 'type', 'two');
											this.pagedata.top_id = item2.id;
											getProductAttrLists(this.pagedata).then(res2 => {
												if (res2.code === 2000) {
													this.$nextTick(() => {
														item2.submenu = res2.data;
														if (item2.submenu && item2
															.submenu.length > 0) {
															item2.submenu.forEach(
																item3 => {
																	this.$set(
																		item3,
																		'selected',
																		false
																		)
																})
														}
													})
												}
											})
										})
									}
									if (submenu2 && submenu2.length > 0) {
										submenu2.forEach(item4 => {
											pageobj.submenu.push(item4);
										})
									}
									this.pageobj = pageobj;
									console.log(555, pageobj)
								}
							})
						}
					})
				} else if (this.pageType === 'prop') { //prop
					this.pagedata.top_id = 0;
					this.pagedata.type = 2;
					getProductCodingLists(this.pagedata).then(res => {
						if (res.code === 2000) {
							let pageobj = {
								type: 'radio',
								submenu: [],
							}
							let submenu = {
								type: 'one',
								submenu: [],
							}
							submenu.submenu = res.data;
							if (submenu.submenu && submenu.submenu.length > 0) {
								submenu.submenu.forEach(item => {
									this.$set(item, 'selected', false);
								})
							}
							pageobj.submenu.push(submenu);
							this.pageobj = pageobj;
						}
					})
				}
			},
			getdata3(){
				taskDataInfos(this.params).then(res => {
					if (res.code === 2000) {
						this.objdata.title = res.data.title;
						this.objdata.img = res.data.img;
						this.objdata.id = res.data.id;
						this.objdata.type = res.data.type;
						this.objdata.flow_path_id = res.data.flow_path_id;
						let objlist = []
						if(!!this.order_id){ //再下一单数据获取
							 
							 orderInfos({order_id:this.order_id}).then(res=>{
							 	if(res.code === 2000){
							 		const {order_flow,order_list,jsondata} = res.data;
							 		this.jsondata = jsondata;
							 		let objlist = []
							 		if(order_list && order_list.length>0){
							 			order_list.forEach(item=>{
							 				let datalist = [];
							 				let textures = [];
							 				this.$set(item, 'datalist', datalist)
							 				this.$set(item, 'textures', textures)
							 				this.$set(item, 'img_name', item.img_name)
							 				this.$set(item, 'delete',2)
							 				this.$set(item, 'attr_data',item.attr)
							 				if(item.data && item.data.length>0){
							 					item.data.forEach(item2=>{
							 						this.$set(item2,'delete',2)
							 						console.log(1111,item2)
							 						if(item2.width === '0.00'){
							 							item2.width = ''
							 						}
							 						if(item2.height === '0.00'){
							 							item2.height = ''
							 						}
							 						if(item2.coding_name !== '定制'){
							 							if (item2.top_id === 0) {
							 								item.datalist.push(item2)
							 								let data = [];
							 								let texture = [];
							 								this.$set(item2,'number',0)
							 								this.$set(item2, 'data', data)
							 								this.$set(item2, 'texture', texture)
							 								if(item.datalist && item.datalist.length>0){
							 									item.datalist.forEach(item3=>{
							 										if (item2.top_id === item3.product_coding_id) {
							 											item3.data.push(item2)
							 											item3.texture.push(item2.texture_name)
							 										}
							 									})
							 								}
							 							}
							 						}else if(item2.coding_name === '定制'){
							 							item.textures.push(item2)
							 						}
							 						
							 					})
							 				}
							 				if(item.data && item.data.length>0){
							 					item.data.forEach(item2=>{
							 						if(item.datalist && item.datalist.length>0){
							 							item.datalist.forEach(item3=>{
							 								if (item2.top_id === item3.product_coding_id) {
							 									item3.data.push(item2)
							 									item3.texture.push(item2.texture_name)
							 								}
							 								if(item3.data && item3.data.length>0){
							 									item3.data.forEach(item4=>{
							 										let data = [];
							 										this.$set(item4, 'data', data)
							 									})
							 								}
							 							})
							 						}
							 					})
							 				}
							 				if(item.data && item.data.length>0){
							 					item.data.forEach(item2=>{
							 						if(item.datalist && item.datalist.length>0){
							 							item.datalist.forEach(item3=>{
							 								if(item3.data && item3.data.length>0){
							 									item3.data.forEach(item4=>{
							 										if (item2.top_id === item4.product_coding_id) {
							 											item4.data.push(item2);
							 											item3.texture.push(item2.texture_name) //增加材质
							 										}
							 									})
							 								}
							 							})
							 						}
							 					})
							 				}
							 				objlist.push(item);
							 			})
							 		}
							 		this.objdata.objlist = objlist;
							 		console.log(88888,this.objdata.objlist)
							 		//this.$forceUpdate() //二维数组，开启强制渲染
							 	}
							 })
							 
						}else{ //pop下单数据
							if(res.data.dataList && res.data.dataList.length>0){
								res.data.dataList.forEach(item=>{
									let datalist = []
									let textures = []
									this.$set(item, 'datalist', datalist)
									this.$set(item, 'textures', textures)
									if(item.data && item.data.length>0){
										item.data.forEach(item2=>{
											console.log(1111,item2)
											this.$set(item2,'texture_id','')
											if(item2.width === '0.00'){
												item2.width = ''
											}
											if(item2.height === '0.00'){
												item2.height = ''
											}
											if (item2.top_id === 0) {
												item.datalist.push(item2)
												let data = [];
												let texture = [];
												this.$set(item2, 'data', data)
												this.$set(item2, 'texture', texture)
												if(item.datalist && item.datalist.length>0){
													item.datalist.forEach(item3=>{
														if (item2.top_id === item3.product_coding_id) {
															item3.data.push(item2)
															item3.texture.push(item2.texture_name)
														}
													})
												}
											}
										})
									}
									if(item.data && item.data.length>0){
										item.data.forEach(item2=>{
											if(item.datalist && item.datalist.length>0){
												item.datalist.forEach(item3=>{
													if (item2.top_id === item3.product_coding_id) {
														item3.data.push(item2)
														item3.texture.push(item2.texture_name)
													}
													if(item3.data && item3.data.length>0){
														item3.data.forEach(item4=>{
															let data = [];
															this.$set(item4, 'data', data)
														})
													}
												})
											}
										})
									}
									if(item.data && item.data.length>0){
										item.data.forEach(item2=>{
											if(item.datalist && item.datalist.length>0){
												item.datalist.forEach(item3=>{
													if(item3.data && item3.data.length>0){
														item3.data.forEach(item4=>{
															if (item2.top_id === item4.product_coding_id) {
																item4.data.push(item2);
																item3.texture.push(item2.texture_name) //增加材质
															}
														})
													}
												})
											}
										})
									}
									objlist.push(item);
								})
							}
						}
						
						this.objdata.objlist = objlist;
						console.log(44444, this.objdata.objlist)
						//流程
						getFlowLists({
							company_id: res.data.company_id
						}).then(res2 => {
							if (res2.code === 2000) {
								if (res2.data && res2.data.length > 0) {
									res2.data.forEach(item => {
										if (res.data.flow_path_id === item.id) {
											this.objdata.flowname = item.title;
										}
									})
								}
							}
						})
					}
				})
				
			},
			resdata4() {
				this.getdata();
			},
			getdata() {
				if(!!this.order_id){
					orderInfos({order_id:this.order_id}).then(res=>{
						console.log(110,res)
						if(res.code === 2000){
							const {order_flow,order_list,jsondata} = res.data;
							this.jsondata = JSON.parse(jsondata);
							this.params.id = this.jsondata.task_id;
							this.order_list = order_list;
							this.getdata3();
						}
					})
				}else{
					this.getdata3();
				}
			},
			rednum1(sel_img_index, index, index2) {
				if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (sel_img_index === i) {
							if (item.datalist && item.datalist.length > 0) {
								item.datalist.forEach((item2, ii) => {
									if (index === ii) {
										if (item2.data && item2.data.length > 0) {
											item2.data.forEach((item3, iii) => {
												if (index2 === iii) {
													if (item3.number > 0) {
														item3.number -= 1
													}
												}
											})
										}
									}
								})
							}
						}
					})
				}
			},
			addnum1(sel_img_index, index, index2) {
				console.log('一级增加', index, index2)
				if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (sel_img_index === i) {
							if (item.datalist && item.datalist.length > 0) {
								item.datalist.forEach((item2, ii) => {
									if (index === ii) {
										if (item2.data && item2.data.length > 0) {
											item2.data.forEach((item3, iii) => {
												if (index2 === iii) {
													item3.number += 1
												}
											})
										}
									}
								})
							}
						}
					})
				}
			},
			rednum2(sel_img_index, index, index2, index3) {
				if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (sel_img_index === i) {
							if (item.datalist && item.datalist.length > 0) {
								item.datalist.forEach((item2, ii) => {
									if (index === ii) {
										if (item2.data && item2.data.length > 0) {
											item2.data.forEach((item3, iii) => {
												if (index2 === iii) {
													if (item3.data && item3.data.length > 0) {
														item3.data.forEach((item4, iiii) => {
															if (index3 === iiii) {
																if (item4.number > 0) {
																	item4.number -= 1
																}
															}
														})
													}
												}
											})
										}
									}
								})
							}
						}
					})
				}
			},
			addnum2(sel_img_index, index, index2, index3) {
				console.log('二级增加', index, index2, index3)
				if (this.objdata.objlist && this.objdata.objlist.length > 0) {
					this.objdata.objlist.forEach((item, i) => {
						if (sel_img_index === i) {
							if (item.datalist && item.datalist.length > 0) {
								item.datalist.forEach((item2, ii) => {
									if (index === ii) {
										if (item2.data && item2.data.length > 0) {
											item2.data.forEach((item3, iii) => {
												if (index2 === iii) {
													if (item3.data && item3.data.length > 0) {
														item3.data.forEach((item4, iiii) => {
															if (index3 === iiii) {
																item4.number += 1
															}
														})
													}
												}
											})
										}
									}
								})
							}
						}
					})
				}
			},
			//下一步
			confirm() {
				console.log(88888,this.objdata.objlist);
				
				let past = true;
				if(this.pageType === 'pop'){
					if(this.objdata.objlist && this.objdata.objlist.length>0){
						this.objdata.objlist.forEach(item=>{
							if (item.textures && item.textures.length > 0) {
								item.textures.forEach((ite, ii) => {
									if(ite.number > 0){
										if(ite.width === '' || ite.height === ''){
											//console.log(9999, ite)
											uni.showToast({
												title:'请输入已增加数量的产品尺寸！',
												icon:'none',
												duration:2000
											})
											past = false
										}
									}
								})
							}
							if(item.datalist && item.datalist.length>0){
								item.datalist.forEach(item2=>{
									if(item2.data && item2.data.length>0){
										item2.data.forEach(item3=>{
											if(item3.has_next === 0){
												if(item3.number > 0){
													if(item3.width === '' || item3.height === ''){
														//console.log(9999, item3)
														uni.showToast({
															title:'请输入已增加数量的产品尺寸！',
															icon:'none',
															duration:2000
														})
														past = false
													}
												}
											}else if(item3.has_next === 1){
												if(item3.data && item3.data.length>0){
													item3.data.forEach(item4=>{
														if(item4.number > 0){
															if(item4.width === '' || item4.height === ''){
																uni.showToast({
																	title:'请输入已增加数量的产品尺寸！',
																	icon:'none',
																	duration:2000
																})
																past = false
															}
														}
													})
												}
											}
										})
									}
								})
							}
						})
					}
				}
				//清除数量为零的图片 或者 编码
				if(this.objdata.objlist && this.objdata.objlist.length>0){
					this.objdata.objlist.forEach((item,index)=>{  //item-图片
						this.$set(item,'num',0);
						if(item.datalist && item.datalist.length>0){
							item.datalist.forEach((item2,index2)=>{ //item2-秋季外套
							this.$set(item2,'has_next',item2.data.length>0?1:0);
								if(item2.has_next === 1 && item2.data && item2.data.length>0){
									item2.data.forEach((item3,index3)=>{ //item3-裤子
									this.$set(item3,'has_next',item3.data.length>0?1:0);
										if(item3.has_next === 1 && item3.data && item3.data.length>0){
											item3.data.forEach((item4,index4)=>{ //item4子菜单
												item2.number += parseInt(item4.number)
												item.num += parseInt(item4.number)
											})
										}else if(item3.has_next === 0){
											item2.number += parseInt(item3.number)
											item.num += parseInt(item3.number)
										}
									})
								}
							})
						}
					})
				}
				console.log(9999, this.objdata.objlist)
				if(past){
					console.log(7777, this.objdata.objlist)
					let ii = [];
					let list = this.objdata.objlist;
					if(this.objdata.objlist && this.objdata.objlist.length>0){
						this.objdata.objlist.forEach((item,index)=>{  //item-图片
							if(item.num > 0){
								let iii = []
								let list2 = item.datalist;
								if(item.datalist && item.datalist.length>0){
									item.datalist.forEach((item2,index2)=>{ //item2-秋季外套
									if(item2.number>0){
										let iiii = []
										let list3 = item2.data;
										if(item2.has_next === 1 && item2.data && item2.data.length>0){
											item2.data.forEach((item3,index3)=>{ //item3-裤子
												if(item3.number === 0 && item3.has_next === 1){
													let iiiii = [];
													let list4 = item3.data;
													if(item3.has_next === 1 && item3.data && item3.data.length>0){
														item3.data.forEach((item4,index4)=>{ //item4子菜单
															if(item4.number>0){
																
															}else{
																iiiii.push(index4)
															}
														})
													}
													if(iiiii && iiiii.length>0){
														iiiii.forEach(ite=>{
															delete list4[ite]
														})
													}
													item3.data = list4.filter(Boolean);
													
												}else if(item3.number === 0 && item3.has_next === 0){
													iiii.push(index3)
												}
											})
										}
										if(iiii && iiii.length>0){
											iiii.forEach(ite=>{
												delete list3[ite]
											})
										}
										item2.data = list3.filter(Boolean);
									}else{
										iii.push(index2)
									}
									if(iii && iii.length>0){
										iii.forEach(ite=>{
											delete list2[ite]
										})
									}
									item.datalist = list2.filter(Boolean);
									})
								}
							}else{
								ii.push(index)
							}
						})
					}
					if(ii && ii.length>0){
						ii.forEach(ite=>{
							delete list[ite]
						})
					}
					this.objdata.objlist = list.filter(Boolean);
					uni.navigateTo({
						url: `/pages/order/PopConfirmOrder?pageType=${this.pageType}&objdata=${JSON.stringify(this.objdata)}`
					})
				}
			},
			//返回
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			//重置筛选
			resetFilterData() {

			},
			//确认筛选
			setFilterData() {
				let product_attr_id = [];
				let product_coding_id = [];

				if (this.pageobj.submenu && this.pageobj.submenu.length > 0) {
					this.pageobj.submenu.forEach(item => {
						if (item.type === 'one') {
							if (item.submenu && item.submenu.length > 0) {
								item.submenu.forEach(item2 => {
									if (item2.selected) {
										product_coding_id.push(item2.id)
									}
								})
							}
						}
						if (item.type === 'two') {
							if (item.submenu && item.submenu.length > 0) {
								item.submenu.forEach(item2 => {
									if (item2.selected) {
										product_attr_id.push(item2.id)
									}
								})
							}
						}
					})
				}
				console.log(22, product_attr_id, product_coding_id)
				this.params.product_attr_id = product_attr_id;
				this.params.product_coding_id = product_coding_id;
				this.getdata();
			},
			//点击筛选
			selectRadioLabel(index, ind, selected) {
				console.log(11, index, ind, selected)
				if (this.pageobj.submenu && this.pageobj.submenu.length > 0) {
					this.pageobj.submenu.forEach((item, i) => {
						if (item.type === 'one') {
							if (index === i) {
								if (item.submenu && item.submenu.length > 0) {
									item.submenu.forEach((item2, ii) => {
										if (ind === ii) {
											item2.selected = !selected;
										}
									})
								}
							}
						} else if (item.type === 'two') {
							if (index === i) {
								if (item.submenu && item.submenu.length > 0) {
									item.submenu.forEach((item2, ii) => {
										if (ind === ii) {
											item2.selected = !selected;
										} else {
											item2.selected = false;
										}
									})
								}
							}
						}
					})
				}
			},
			change1(e) {
				if (!e.show) {
					this.showtip = false;
				}
			},
			//取消
			cancel(type) {
				this['show' + type] = false
			},
			loadmore() {

			},
		}
	}
</script>

<style lang="scss">
	/* 提示窗口 */
	.w-tip2 {
		/* #ifndef APP-NVUE */
		display: flex;
		flex-direction: column;
		/* #endif */
		width: 70vw;
		border-radius: 10rpx;
		background-color: #fff;
		box-shadow: 0rpx 7rpx 7rpx 0rpx rgba(0, 0, 0, 0.1);
		margin: 30rpx auto 0;

		.w-tit {
			font-size: 36rpx;
			font-weight: bold;
			color: $font-color-3;
			line-height: 60rpx;
			height: 60rpx;
			margin-top: 20rpx;
			text-align: center;
		}

		.w-but {
			display: flex;
			font-size: 32rpx;
			font-weight: 400;
			color: $font-color-b3;
			height: 84rpx;
			line-height: 84rpx;

			.w-but-txt {
				flex: 1;
				text-align: center;
				border-right: 1rpx solid #f5f5f5;
			}

			.w-but-txt:last-of-type {
				border-right: none;
			}
		}

		.w-con {
			display: flex;
			text-align: center;
			font-weight: 400;
			padding: 30rpx 30rpx;
			border-bottom: 1rpx solid #f5f5f5;

			.txt-row {
				width: 100%;
				text-align: center;
				font-size: 28rpx;
				color: $font-color-9;
			}

			.txt-input {
				border: 1rpx solid #f5f5f5;
				height: 60rpx;
				width: 100%;
			}
		}
	}

	/* 提示窗口 */
	.w-tip {
		/* #ifndef APP-NVUE */
		display: flex;
		flex-direction: column;
		/* #endif */
		width: 80vw;
		min-height: 300rpx;
		border-radius: 10rpx;
		background-color: #fff;
		box-shadow: 0rpx 7rpx 7rpx 0rpx rgba(0, 0, 0, 0.1);
		margin: 30rpx auto 0;
	
		.w-tit {
			font-size: 36rpx;
			font-weight: bold;
			color: $font-color-3;
			line-height: 90rpx;
			height: 90rpx;
			text-align: center;
			border-bottom: 1rpx solid #f5f5f5;
		}
	
		.w-but {
			display: flex;
			font-size: 32rpx;
			font-weight: 400;
			color: $font-color-b3;
			height: 84rpx;
			line-height: 84rpx;
	
			.w-but-txt {
				flex: 1;
				text-align: center;
				border-right: 1rpx solid #f5f5f5;
			}
	
			.w-but-txt:last-of-type {
				border-right: none;
			}
		}
	
		.w-con {
			display: flex;
			flex-direction: column;
			height: 400rpx;
			font-size: 32rpx;
			font-weight: 400;
			color: $font-color-3;
			border-bottom: 1rpx solid #f5f5f5;
	
			.w-con-t {
				font-size: 28rpx;
				font-weight: 400;
				color: $font-color-3;
				padding: 10rpx 30rpx;
			}
	
			.w-con-c {
				display: flex;
				flex-wrap: wrap;
				padding: 10rpx 30rpx;
	
				.w-con-c-li {
					height: 52rpx;
					line-height: 52rpx;
					padding: 0 20rpx;
					margin: 0 20rpx 20rpx 0;
					border-radius: 6rpx;
					font-size: 28rpx;
					font-weight: 400;
				}
			}
		}
	}

	/* 提示窗口 */
	.w-tip3 {
		/* #ifndef APP-NVUE */
		display: flex;
		flex-direction: column;
		/* #endif */
		width: 100vw;
		min-height: 100rpx;
		border-radius: 20rpx 20rpx 0px 0px;
		background-color: #fff;
		box-shadow: 0rpx 7rpx 7rpx 0rpx rgba(0, 0, 0, 0.1);
		padding: 20rpx 0rpx;
		margin: 30rpx auto 0;

		.w-con {
			line-height: 100rpx;
			font-size: 32rpx;
			font-weight: 400;
			color: $font-color-3;
			text-align: center;

			.w-con-txt {
				border-bottom: 1rpx solid #f5f5f5;
			}

			.w-con-cen {
				color: #198FFF;
			}
		}
	}

	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
		background: $uni-bg-color;
		display: block;
		position: sticky;
		top: 0rpx;
		z-index: 9999;
		overflow: hidden
	}

	.page-content {
		border-top: 1rpx solid #f5f5f5;
		width: 100vw;
		height: 100%;
		background: $uni-bg-color-grey;

		.page-top {
			display: flex;
			flex-direction: column;
			box-sizing: content-box;
			background: $uni-bg-color;
			display: block;
			position: sticky;
			top: 0rpx;
			z-index: 9999;
			border-bottom: 1rpx solid #f5f5f5;
		}

		.page-body {
			display: flex;
			height: calc(100% - 180rpx - var(--status-bar-height));
			padding: 0;

			.btn-box {
				width: 100%;
				position: fixed;
				left: 0;
				right: 0;
				bottom: 0;
				height: 90rpx;
				display: flex;
				flex-shrink: 0;
				flex-direction: row !important;
				align-items: center;
				font-size: 36rpx;
				line-height: 90rpx;
				color: $font-color-w;

				.submit {
					text-align: center;
					flex: 2;
					background-color: #198FFF;
				}
			}


			.body-box {
				display: flex;
				flex-direction: column;
				background: $uni-bg-color;
				margin-bottom: 20rpx;

			}

		}
	}
</style>
